<?php if (!defined('THINK_PATH')) exit(); /*a:4:{s:106:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/public/../application/admin/view/facrm/backlog/contract.html";i:1676906865;s:88:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/layout/default.html";i:1676906865;s:85:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/common/meta.html";i:1676906865;s:87:"/mnt/client2023/d-crmqing.bigchun.com/fastcrm/application/admin/view/common/script.html";i:1676906865;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
<title><?php echo (isset($title) && ($title !== '')?$title:''); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="renderer" content="webkit">
<meta name="referrer" content="never">
<meta name="robots" content="noindex, nofollow">

<link rel="shortcut icon" href="/assets/img/favicon.ico" />
<!-- Loading Bootstrap -->
<link href="/assets/css/backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">

<?php if(\think\Config::get('fastadmin.adminskin')): ?>
<link href="/assets/css/skins/<?php echo \think\Config::get('fastadmin.adminskin'); ?>.css?v=<?php echo \think\Config::get('site.version'); ?>" rel="stylesheet">
<?php endif; ?>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/assets/js/html5shiv.js"></script>
  <script src="/assets/js/respond.min.js"></script>
<![endif]-->
<script type="text/javascript">
    var require = {
        config:  <?php echo json_encode($config); ?>
    };
</script>

    </head>

    <body class="inside-header inside-aside <?php echo defined('IS_DIALOG') && IS_DIALOG ? 'is-dialog' : ''; ?>">
        <div id="main" role="main">
            <div class="tab-content tab-addtabs">
                <div id="content">
                    <div class="row">
                        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                            <section class="content-header hide">
                                <h1>
                                    <?php echo __('Dashboard'); ?>
                                    <small><?php echo __('Control panel'); ?></small>
                                </h1>
                            </section>
                            <?php if(!IS_DIALOG && !\think\Config::get('fastadmin.multiplenav') && \think\Config::get('fastadmin.breadcrumb')): ?>
                            <!-- RIBBON -->
                            <div id="ribbon">
                                <ol class="breadcrumb pull-left">
                                    <?php if($auth->check('dashboard')): ?>
                                    <li><a href="dashboard" class="addtabsit"><i class="fa fa-dashboard"></i> <?php echo __('Dashboard'); ?></a></li>
                                    <?php endif; ?>
                                </ol>
                                <ol class="breadcrumb pull-right">
                                    <?php foreach($breadcrumb as $vo): ?>
                                    <li><a href="javascript:;" data-url="<?php echo $vo['url']; ?>"><?php echo $vo['title']; ?></a></li>
                                    <?php endforeach; ?>
                                </ol>
                            </div>
                            <!-- END RIBBON -->
                            <?php endif; ?>
                            <div class="content">
                                
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row">
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-number" class="control-label col-xs-12 col-sm-2"><?php echo __('合同编号'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-number" data-rule="required" type="text" class="form-control" name="row[number]" value="<?php echo $row['number']; ?>" disabled />
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-name" class="control-label col-xs-12 col-sm-2"><?php echo __('合同名称'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-name" data-rule="required" type="text" class="form-control" name="row[name]" value="<?php echo $row['name']; ?>" disabled />
            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-customer_id" class="control-label col-xs-12 col-sm-2"><?php echo __('选择客户'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-customer_id" data-rule="required" data-source="facrm/customer/index"
                       class="form-control selectpage"  type="text" value="<?php echo $row['customer_id']; ?>" disabled>

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group business_id_div" >
            <label for="c-business_id" class="control-label col-xs-12 col-sm-2"><?php echo __('选择商机'); ?>:</label>
            <div class="col-xs-12 col-sm-10">


                <input id="c-business_id" data-rule="required" data-source="facrm/business/index/index"
                       class="form-control selectpage" name="" type="text" value="<?php echo $row['business_id']; ?>"  disabled>

            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-money" class="control-label col-xs-12 col-sm-2"><?php echo __('合同金额'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-money" type="number"  class="form-control" name="row[money]" value="<?php echo $row['money']; ?>" disabled  />
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-order_time" class="control-label col-xs-12 col-sm-2"><?php echo __('下单时间'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-order_time"  value="<?php echo datetime($row['order_time']); ?>"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[order_time]" type="text" disabled >
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-start_time" class="control-label col-xs-12 col-sm-2"><?php echo __('合同开始时间'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-start_time"  value="<?php echo datetime($row['start_time']); ?>"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[start_time]" type="text" disabled >
            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-end_time" class="control-label col-xs-12 col-sm-2"><?php echo __('合同结束时间'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-end_time"  value="<?php echo datetime($row['end_time']); ?>"  class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm" data-use-current="true" name="row[end_time]" type="text" disabled >
            </div>
        </div>


        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-contract_id" class="control-label col-xs-12 col-sm-2"><?php echo __('客户签约人'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-contacts_id" data-rule="required" data-source="facrm/contract/index/selectcontact"
                       class="form-control selectpage" name="row[contacts_id]" type="text" value="<?php echo $row['contacts_id']; ?>" disabled >

            </div>
        </div>

        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-order_admin_id" class="control-label col-xs-12 col-sm-2"><?php echo __('公司签约人'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-order_admin_id" data-rule="required" data-source="facrm/common/selectpage/model/admin/type/all" data-field="nickname"
                       class="form-control selectpage" name="row[order_admin_id]" type="text" value="<?php echo $row['order_admin_id']; ?>"  disabled >

            </div>
        </div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-flow_admin_id" class="control-label col-xs-12 col-sm-2"><?php echo __('待审批人'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <input id="c-flow_admin_id"   data-source="facrm/common/selectpage/model/admin/type/all" data-field="nickname" data-multiple="true"  <?php echo $flow->config==1?'disabled':''; ?>
                class="form-control selectpage" name="row[flow_admin_id]" type="text" value="<?php echo $row->flow_admin_id; ?>">
            </div>
        </div>
        <div id="extend"></div>
        <div class="col-md-4 col-xs-12 form-group">
            <label for="c-remark" class="control-label col-xs-12 col-sm-2"><?php echo __('备注'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <textarea id="c-remark" class="form-control" name="row[remark]" disabled><?php echo $row['remark']; ?></textarea>
            </div>
        </div>
    </div>

    <div class="row">
            <div class="col-md-10 col-xs-12 form-group">
                <label  class="control-label col-xs-12 col-sm-2"><?php echo __('产品列表'); ?>:</label>
                <div class="col-xs-12 col-sm-10">
                    <div class="table-responsive" >
                        <table id="table" class="table table-striped table-bordered table-hover table-nowrap">
                            <thead>
                            <th><?php echo __('序号'); ?></th>
                            <th><?php echo __('Sku'); ?></th>
                            <th style="width: 100px"><?php echo __('商品'); ?></th>
                            <th><?php echo __('规格'); ?></th>
                            <th><?php echo __('属性'); ?></th>
                            <th ><?php echo __('单位'); ?></th>
                            <th style="width: 80px"><?php echo __('数量'); ?></th>
                            <th style="width: 80px"><?php echo __('单价'); ?></th>
                            <th><?php echo __('小计'); ?></th>
                            <th><?php echo __('备注'); ?></th>

                            </thead>
                            <tbody>
                            <?php if(is_array($product_list) || $product_list instanceof \think\Collection || $product_list instanceof \think\Paginator): if( count($product_list)==0 ) : echo "" ;else: $i=0; foreach($product_list as $key=>$vo): ++$i; ?>
                            <tr>
                                <td><?php echo $i; ?></td>
                                <td><?php echo $vo['info']['sku']; ?></td>
                                <td>
                                    <input date-rule="required;" style="width: 100px" value="<?php echo $vo['info']['name']; ?>"  type="text" name="product[<?php echo $i; ?>][name]" data-index="<?php echo $i; ?>" class="find" class="" data-toggle="modal" data-target="#modelProduct" disabled >
                                </td>
                                <td class="gg"><?php echo $vo['specification']; ?></td>
                                <td>
                                    <?php echo $vo['prop']; ?>
                                </td>
                                <td class="unit"><?php echo $vo['unit']; ?></td>
                                <td>
                                    <?php echo $vo['nums']; ?>
                                </td>
                                <td>
                                    <?php echo $vo['price']; ?>
                                </td>
                                <td class="subtotal">
                                    <?php echo $vo['subtotal']; ?>
                                </td>
                                <td> <?php echo $vo['remarks']; ?></td>
                            </tr>
                            <?php endforeach; endif; else: echo "" ;endif; ?>

                            </tbody>
                        </table>
                    </div>
                    <div>

                        <div class="row">
                            <div class="col-md-6 col-xs-6">
                                <label class="control-label col-xs-12 col-sm-6"><?php echo __('优惠率%'); ?>:</label>
                                <div class="col-xs-12 col-sm-6">
                                    <label class="control-label "> <?php echo $row['discount_rate']; ?></label>
                                </div>
                            </div>
                            <div class="col-md-6 col-xs-6">
                                <label class="control-label col-xs-12 col-sm-6"> <?php echo __('总额 $'); ?>:</label>
                                <div class="col-xs-12 col-sm-6">
                                    <label class="control-label "> <?php echo $row['total_price']; ?></label>

                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
    </div>


    <div class="row">
        <div class="col-md-10 col-xs-12 form-group">
            <label  class="control-label col-xs-12 col-sm-2"><?php echo __('审核日志'); ?>:</label>
            <div class="col-xs-12 col-sm-10">
                <div class="table-responsive">
                    <table id="table11" class="table table-striped table-bordered table-hover table-nowrap">
                        <thead>
                        <th><?php echo __('顺序'); ?></th>
                        <th><?php echo __('审核人'); ?></th>
                        <th><?php echo __('意见'); ?></th>
                        <th><?php echo __('状态'); ?></th>
                        </thead>
                        <tbody>
                        <?php if(is_array($log_list) || $log_list instanceof \think\Collection || $log_list instanceof \think\Paginator): if( count($log_list)==0 ) : echo "" ;else: $j=0; foreach($log_list as $key=>$v): ++$j; ?>
                        <tr>
                            <td><?php echo $j; ?></td>
                            <td>
                                <?php echo $v['nickname']; ?>(<?php echo $v['admin_id']; ?>)
                            </td>
                            <td>
                                <?php echo $v['remark']; ?><?php echo $v['is_end']==1?"（审核结束）":""; ?>
                            </td>
                            <td>
                                <?php echo $v['status']==1?"通过":"未通过"; ?>
                            </td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <?php if($flow->config==0): ?>
    <!-- Modal -->
    <style>
        .modal-backdrop{z-index: 1;}
        .modal {z-index: 2;}
    </style>
    <div class="modal fade" id="modelProduct"  role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document" >
            <div class="modal-content" >
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel"><?php echo __('审核提示'); ?></h4>
                </div>
                <div class="modal-body">
                    <div id="lays-row" class="row">

                        <div class="col-md-4 col-xs-12 form-group">
                            <label for="c-next_admin_id" class="control-label col-xs-12 col-sm-4"><?php echo __('下个审批人'); ?>:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-next_admin_id"   data-source="facrm/common/selectpage/model/admin/type/all" data-field="nickname" data-multiple="true"
                                class="form-control selectpage" name="next_admin_id" type="text" value="">
                                <span class="text-red">*如果要结束审批请不要选择审批人</span>
                            </div>
                        </div>

                        <div class="col-md-4 col-xs-12 form-group">
                            <label class="control-label col-xs-12 col-sm-4"></label>
                            <div class="col-xs-12 col-sm-8">
                                <button type="button" class="btn btn-success btn-embossed  "><?php echo __('审核通过'); ?></button>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <?php if($flow->config==0): ?>
            <button type="button" class="btn btn-primary btn-embossed  " data-toggle="modal"  data-target="#modelProduct"><?php echo __('审核'); ?></button>
            <?php else: ?>
            <button type="button" class="btn btn-success btn-embossed  "><?php echo __('审核通过'); ?></button>
            <?php endif; ?>


            <button type="button" class="btn btn-danger btn-embossed btn-reject"><?php echo __('驳回'); ?></button>
        </div>
    </div>
</form>
<script>
    var ids=<?php echo input('ids'); ?>;
    var types="<?php echo input('types'); ?>";
</script>



                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="/assets/js/require<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js" data-main="/assets/js/require-backend<?php echo \think\Config::get('app_debug')?'':'.min'; ?>.js?v=<?php echo htmlentities($site['version']); ?>"></script>
    </body>
</html>
